package day06;

import java.util.Scanner;

public class MethodDemo {
    public static void main(String[] args) {
        //say();

        //String  name

        //int age;

        //System.out.println("继续执行");
        sayName();
        sayName();

        /*int a = 5;
        int b = 5;
        int sum = plusNum(a, b);
        System.out.println(sum);
        int c = plusNum(5, 2);
        System.out.println(c);

        double s = Num();
        System.out.println(s);*/

        /*int[] b = testArray(5,100);
        re(b);
        System.out.println("最后一个数是"+ret(b));*/


        /*sayHi("张三",12);
        sayHi("李四",60);*/
    }


    /*public static int ret(int[] arr) {

        return arr[arr.length - 1];
    }*/

    /*public static void re(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }*/

    /*public static int[] testArray(int len, int max) {
        int[] arr = new int[len];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * (max + 1));
        }
        return arr;
    }*/


    /*public static double Num() {
        return 3.14;
    }

    public static int plusNum(int a, int b) {

        return a + b;
    }*/

    /*public static void say() {
        System.out.println("你好,helloworld");
    }*/

    public static void sayName() {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入你的名字");
        String name = scan.next();
        System.out.println("请输入你的年龄");
        int age = scan.nextInt();
        if (age > 30) {
            System.out.println("输入错误");
            return;
        }
        System.out.println("我是"+name+",我今年"+age+"岁了");

    }
    }

